//
//  main.cpp
//  Learn_C_Cpp
//
//  Created by jinbang.li on 2023/4/24.
//

#include <iostream>
#include "Person.hpp"
#include "Caculate.hpp"
/**
 C的编译器与C++编译器不同
 生成的函数签名也不同
 这里C文件需要加上 extern “C” 使用C编译器编译
 */
extern "C"{
#include "HookTest.h"
}

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    Person p1 = Person();
    std::cout << &(p1.getNameReference())<< "\n";
    std::cout << p1.getNameValue()<< "\n";
    Calculate<int> cal =  Calculate<int>(1,2);
    int result = cal.add();
    printf("result===%d\n",result);
    result = cal.sub();
    printf("result===%d\n",result);
    result = cal.mul();
    printf("result===%d\n",result);
    result = cal.div();
    printf("result===%d\n",result);
    
    //测试构子函数
    testHook();
    return 0;
}
